<template>
	<view>
		<view class="title">
			{{article?.title}}
		</view>
		<view class="content">
			<zero-markdown-view :markdown="article?.content"></zero-markdown-view>
		</view>
	</view>
</template>

<script>
	import request from '@/common/request.js'
	export default {
		onLoad: function(option) {
			this.setContent(option.id)
		},
		data() {
			return {
				article: null
			};
		},
		methods: {
			setContent(id) {
				request.httpRequest({
					url: 'wx/detail/'+id,
					method: 'GET'
				}).then(res => {
					this.article = res.data
				})
			}
		}
	}
</script>

<style lang="scss">
	.title {
		font-weight: 700;
		font-size: 50rpx;
		margin: 10rpx;
		text-align: center;
	}
	.content {
		margin: 10rpx 25rpx;
	}
</style>